package main

import (
	"context"
	"fmt"

	"gitee.com/xjsys/rpctest/message"
	"google.golang.org/grpc"
)

func main() {
	conn, err := grpc.Dial("localhost:8090", grpc.WithInsecure())
	if err != nil {
		panic(err.Error())
	}
	defer conn.Close()

	cmdServiceClient := message.NewCmdServiceClient(conn)
	cmdRequest := &message.CmdRequest{Cmd: "ls"}
	orderInfo, err := cmdServiceClient.GetCmdInfo(context.Background(), cmdRequest)
	if err == nil {
		fmt.Println(orderInfo.GetResponse())
	}
}
